﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using FM.Common;
using FM.Events;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.Mvvm;
using Microsoft.Practices.Prism.PubSubEvents;

namespace FM.录音.ViewModels
{
    public class 选项视图ViewModel : BindableBase
    {
        private readonly IEventAggregator 新闻部;
        private int _比特率;
        private int _采样率;
        private string _录音格式;
        private string _播放声卡;
        private string _录音声卡;

        public 选项视图ViewModel()
        {

            新闻部 = 小冰.新闻部;
            确定Command = new DelegateCommand<object>(确定Action);
            取消Command = new DelegateCommand<object>(取消Action);

        }

        private void 取消Action(object obj)
        {
            新闻部.GetEvent<状态栏更新Event>().Publish(new 状态栏Data1(Enum状态栏.提示, "取消选项设置"));
        }

        private void 确定Action(object obj)
        {
            新闻部.GetEvent<状态栏更新Event>().Publish(new 状态栏Data1(Enum状态栏.提示, "确定选项设置"));
        }

        public ICommand 确定Command { get; set; }
        public ICommand 取消Command { get; set; }


        public ObservableCollection<string> 录音声卡list { get; set; }
        public ObservableCollection<string> 播放声卡list { get; set; }

        public string 录音声卡
        {
            get { return _录音声卡; }
            set { SetProperty(ref _录音声卡, value); }

        }

        public string 播放声卡
        {
            get { return _播放声卡; }
            set { SetProperty(ref _播放声卡, value); }

        }

        public string 录音格式
        {
            get { return _录音格式; }
            set { SetProperty(ref _录音格式, value); }

        }

        public int 采样率
        {
            get { return _采样率; }
            set { SetProperty(ref _采样率, value); }
        }

        public int 比特率
        {
            get { return _比特率; }
            set { SetProperty(ref _比特率, value); }
        }
    }
}
